<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
  pageEncoding="ISO-8859-1"%>

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Annotate Message</title>
<link href="conversation.css" rel="STYLESHEET" type="text/css">
<jsp:include page="scripts/toggleLayer.js" />

</head>
<body>
<!--        Header         -->
<jsp:include page="scripts/headerAnnotate.jsp">
  <jsp:param name="title" value="Annotate Message" />
</jsp:include>
<!--       Navigation        -->
<jsp:include page="scripts/mnavigation.jsp" />
<!--        Metadata         -->
<div class="meta">
<table>
  <tr>
    <th width="125">Data Set ID:</th>
    <td><c:out value="${message.conversation.dataset.datasetId}" /></td>
    <th>Conversation ID:</th>
    <td><c:out value="${message.conversation.conversationId}" /></td>
    <th>Message ID:</th>
    <td><c:out value="${message.messageId}" /></td>
  </tr>
  <tr>
    <th>Sequence:</th>
    <td><c:out value="${message.sequence}" /></td>
    <th>Speaker:</th>
    <td><c:out value="${message.speaker}" /></td>
    <th>Type:</th>
    <td><c:out value="${message.type}" /></td>
  </tr>
  <tr>
    <th>Date Time:</th>
    <td colspan="5"><c:out value="${message.dateTime}" /></td>
  </tr>
  <tr>
    <th>Content:</th>
    <td colspan="5"><c:out escapeXml="false"
      value="${message.contentString}" /></td>
  </tr>
  <form:form commandName="message">
    <tr>
      <th>Note:</th>
      <td colspan="5" align="center">
      <form:textarea path="note" cols="60" rows="3" /></td>
    </tr>
    <tr>
      <th>Annotation:</th>
      <td colspan="5">
      <div class="annotate">
      <table border="0">
        <!-- For each annotation scheme  -->
        <c:forEach items="${daschemes}" var="dascheme">
          <tr>
            <td valign="top"><a
              href="javascript:toggleLayer('<c:out value="${dascheme}"/>')"><b><c:out
              value="${dascheme}" />:</b></a></td>
          </tr>
          <tr>
            <td valign="top">
            <div class="annoPanel" id="<c:out value='${dascheme}'/>">
            <!-- selector -->
            <c:forEach items="${dalabels}" var="dalabel">
            <c:if test="${dalabel.dialogueActDimension.dialogueActScheme.dialogueActSchemeId == dascheme.dialogueActSchemeId}">
                <c:out value="${dalabel.dialogueActDimension.dimension}"/> : <c:out value="${dalabel.label}"/>:
                <form:checkbox path="dialogueActLabels" value='${dalabel.dialogueActLabelId}'/> <br />
            </c:if>
            </c:forEach>
            </div>
            </td>
          </tr>
        </c:forEach>
      </table>
      </div>
      </td>
    </tr>
    <tr>
      <td colspan="7"><input type="submit" value="Save" /> <input
        type="button" value="Cancel"
        onClick="javascript:window.location='annotatemessage.jsp'" /></td>
    </tr>
  </form:form>
</table>
<jsp:include page="scripts/footer.jsp" />
</body>
</html>
